package com.gqz.equip.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * 物资-设备类型树
 *
 * @author gqz20
 * @date 2023/02/18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_WZ_SBLX")
public class TEnWzSblxEntity implements Serializable {

    /**
     * 设备类型id
     */
    @TableId
    private String id;

    /**
     * 设备类型名称
     */
    @TableField(value = "NAME")
    private String name;

    /**
     * 父级设备类型id
     */
    @TableField(value = "PID")
    private String pid;

    /**
     * 层级
     */
    @TableField(value = "IS_LEAF")
    private String isLeaf;

    /**
     * 排序
     */
    @TableField(value = "ORDER_NO")
    private String orderNo;

    /**
     * 是否删除 0否1是
     */
    @TableField(value = "SFSC")
    private String sfsc;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<TEnWzSblxEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", TEnWzSblxEntity::getId);
        map.put("name", TEnWzSblxEntity::getName);
        map.put("pid", TEnWzSblxEntity::getPid);
        map.put("isLeaf", TEnWzSblxEntity::getIsLeaf);
        map.put("orderNo", TEnWzSblxEntity::getOrderNo);
        map.put("sfsc", TEnWzSblxEntity::getSfsc);

    }

    public static SFunction<TEnWzSblxEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end这个是必须要的动态条件集合end   end */


}
